use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet};

// 衣服商品结构
#[derive(Debug, Clone)]
pub struct Clothing {
    pub id: String,
    pub name: String,
    pub category: String, // 上衣/裤子/裙子等
    pub price: f64,
    pub color: HashSet<String>,
    pub stock: i32,       // 库存数量
    pub suitable_season: HashSet<String>, // 适合季节
    pub size: HashSet<String>, // 适合尺寸
    pub material: HashSet<String>, // 适合材料
    pub brand: String,
    pub description: String,
}

// 工具调用指令和结果（复用之前的结构，添加销售场景适配）
#[derive(Debug, Serialize, Deserialize)]
pub struct ToolCall {
    name: String,
    parameters: HashMap<String, serde_json::Value>,
}

#[derive(Debug)]
pub struct ToolResult {
    pub success: bool,
    pub content: String,
}

// 工具接口
pub trait Tool {
    fn name(&self) -> &str;
    fn run(&self, params: &HashMap<String, serde_json::Value>) -> Result<ToolResult, String>;
}